// 动态导入图片资源
const requireContext = require.context('@/assets/images/madel', false, /\.png$/);

const iconMap = new Map();

// 获取文件路径并排序
const paths = requireContext.keys().sort((a, b) => {
  const numA = parseInt(a.match(/(\d+)\.png$/)[1], 10);
  const numB = parseInt(b.match(/(\d+)\.png$/)[1], 10);
  return numA - numB;
});

// 按顺序导入文件并生成 iconMap
paths.forEach((path, index) => {
  const image = requireContext(path);
  iconMap.set(index + 1, image.default || image);
});

export { iconMap };
